<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <!-- v-model 数据双向绑定  修改视图，数据也会同步改变 在单选、多选中还能将一组单选、多选相关联-->
    <label for="men">
      <input type="radio" id="men" value="男" v-model="gender">男</label>
    <label for="women">
      <input type="radio" id="women" value="女" v-model="gender">女</label>
    <br>
    {{gender}}
    <br>
    <label for="hobby1">
      <input type="checkbox" id="hobby1" v-model="hobbies" value="music">music
    </label>
    <label for="hobby2">
      <input type="checkbox" id="hobby2" v-model="hobbies" value="draw">draw
    </label>
    <label for="hobby3">
      <input type="checkbox" id="hobby3" v-model="hobbies" value="ghs">ghs
    </label>
    <label for="hobby4">
      <input type="checkbox" id="hobby4" v-model="hobbies" value="movie">movie
    </label>
    <br>
    {{hobbies}}
  </div>
  <script src="../vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        msg: 'hello world',
        gender: "未知",
        hobbies: ['music']
      },
    })
  </script>
</body>

</html>